<?php
auth_redirect();
check_user_is_admin();

$xajax = new xajax(); 
//$xajax->debugOn(); // Uncomment this line to turn debugging on
$xajax->registerFunction("logoutFunc");

$xajax->registerFunction("saveEditTag");
$xajax->registerFunction("saveDeleteTag");
$xajax->registerFunction("searchTag");
$xajax->processRequests();
?>

<?php get_header(); ?>

<DIV id=container>
<BR/>

<DIV id=searchform>

<table>
<tr>
    <th class="short">&nbsp;</th>
    <th class="short">名称</th>
    <th class="short"><span class="info_s">附属名</span></th>
    <th class="short"><span class="info_s">上级ID</span></th>
    <th class="short"><span class="info_s">附注1</span></th>
    <th class="short"><span class="info_s">附注2</span></th>
    <th class="short"><span class="info_s">重要度(1-10)</span></th>
    <th class="short"><span class="info_s">图片URL</span></th>
    <th class="short">&nbsp;</th>
    <th class="short">&nbsp;</th>
</tr>

	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>	

<tr class="withover">
	<td class="count"><span><?php the_tagadmin_id(); ?><span></td>
    <td class="short"><input type="text" id="name<?php the_tagadmin_id(); ?>" name="name<?php the_tagadmin_id(); ?>" value="<?php the_tagadmin_name(); ?>" size="10" /></td>
    <td class="short"><input type="text" id="nicename<?php the_tagadmin_id(); ?>" name="nicename<?php the_tagadmin_id(); ?>" value="<?php the_tagadmin_nicename(); ?>" size="10" /></td>
    <td class="short"><input type="text" id="parent<?php the_tagadmin_id(); ?>" name="parent<?php the_tagadmin_id(); ?>" value="<?php the_tagadmin_parent(); ?>" size="5" /></td>
    <td class="short"><input type="text" id="long<?php the_tagadmin_id(); ?>" name="long<?php the_tagadmin_id(); ?>" value="<?php the_tagadmin_long(); ?>" size="8" /></td>
    <td class="short"><input type="text" id="lati<?php the_tagadmin_id(); ?>" name="lati<?php the_tagadmin_id(); ?>" value="<?php the_tagadmin_lati(); ?>" size="8" /></td>
    <td class="short"><input type="text" id="zoom<?php the_tagadmin_id(); ?>" name="zoom<?php the_tagadmin_id(); ?>" value="<?php the_tagadmin_zoom_in(); ?>" size="2" /></td>
    <td class="short"><input type="text" id="photo<?php the_tagadmin_id(); ?>" name="photo<?php the_tagadmin_id(); ?>" value="<?php the_tagadmin_photo_url(); ?>" size="70" /></td>
    <td class="short"><input type="submit" value="保存" onclick="xajax_saveEditTag(<?php the_tagadmin_id(); ?>,document.getElementById('name<?php the_tagadmin_id(); ?>').value,document.getElementById('nicename<?php the_tagadmin_id(); ?>').value,document.getElementById('parent<?php the_tagadmin_id(); ?>').value,document.getElementById('long<?php the_tagadmin_id(); ?>').value,document.getElementById('lati<?php the_tagadmin_id(); ?>').value,document.getElementById('zoom<?php the_tagadmin_id(); ?>').value,document.getElementById('photo<?php the_tagadmin_id(); ?>').value);" /></td>
    <td class="short"><input type="submit" value="删除" onclick="confirmDeleteTag(<?php the_tagadmin_id(); ?>);" /></td>
</tr>

	<?php endwhile; else: ?>
		<?php //header("location:./"); ?>
	<?php endif; ?>

</table>

	<div class="pages">
	<?php get_post_nav(); ?>
	</div>

<br/>
<DIV class=instruction>
<DIV>
<h5>搜索:</h5>
<input type="text" id="searchkeyword" name="searchkeyword" value="" size="30" /> <input type="submit" value="搜索" onclick="xajax_searchTag(document.getElementById('searchkeyword').value);" style="height:25px;" /></DIV></DIV><BR/>
<SPAN id=searchtable name=searchtable>
</SPAN>
</DIV>

<?php get_footer(); ?>

